//
//  Session.h
//  MobilCommunity
//
//  Created by easystudio on 7/7/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Member : NSObject {
    NSString* user_id;      //登陆名
    NSString* user_pass;    //登陆mima
    NSString* user_name;    //
    NSString* name_cn;      //用户昵称
    NSString* role_id;      //
    NSString* role_name;    //角色名
    NSString* posi_id;      //
    NSString* posi_name;    //职位名
    BOOL permission;        //权限标识
}
@property (nonatomic, retain) NSString* user_id;
@property (nonatomic, retain) NSString* user_pass;
@property (nonatomic, retain) NSString* user_name;
@property (nonatomic, retain) NSString* name_cn;
@property (nonatomic, retain) NSString* role_id;
@property (nonatomic, retain) NSString* role_name;
@property (nonatomic, retain) NSString* posi_id;
@property (nonatomic, retain) NSString* posi_name;
@property (nonatomic) BOOL permission;

@end


@interface Session : NSObject {
    Member* _sMember;
    BOOL _bLogined;
    BOOL _isChance;//是否启用商机:yes=启用
    int MsgCount1;
    int MsgCount2;
    int MsgCount3;
    int MsgCount4;
    int MsgCount5;
    NSString *MailAddress;
    NSString *CompanyCode;
}

@property (nonatomic) int MsgCount1;
@property (nonatomic) int MsgCount2;
@property (nonatomic) int MsgCount3;
@property (nonatomic) int MsgCount4;
@property (nonatomic) int MsgCount5;
@property (nonatomic, retain) NSString *MailAddress;
@property (nonatomic, retain) NSString *CompanyCode;

+ (Session*) share;
- (Session*) init;
- (NSString*) getMemberID;
- (NSString*) getMemberPass;
- (NSString*) getMemberName;
- (NSString*) getMemberNickName;
- (NSString*) getMemberRoleID;
- (NSString*) getMemberRoleName;
- (NSString*) getMemberPosiID;
- (NSString*) getMemberPosiName;
- (BOOL) getMemberPermission;

- (Member *) getMember;
- (void) setMember:(NSMutableDictionary *)member;

-(void)printMember;

- (void) logout;

-(BOOL) isLogined;
-(void) setLoginFlag:(BOOL) flag;

-(BOOL) getPermission;
-(void) setPermission:(BOOL) perm;

-(BOOL) isChance;
-(void) setChance:(BOOL) flag;

@end
